package com.wicket.okrapp.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrapp.biz.service.DashboardAchievementService;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import com.wicket.okrapp.common.ro.OkrResult;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/app/dashboardAchievement/")
public class DashboardAchievementController {

  @Autowired
  DashboardAchievementService dashboardAchievementService;
/**
   * D3查询目标内容成果关系By一级指标列表(公共)
   */
    @PostMapping("queryTargetContAchievementDockByFirstObjListCom")
    public OkrResult<QueryTargetContAchievementDockByFirstObjListComRespDto> queryTargetContAchievementDockByFirstObjListCom(@RequestBody @Validated QueryTargetContAchievementDockByFirstObjListComReqDto reqDTO){
    return OkrResult.success(dashboardAchievementService.queryTargetContAchievementDockByFirstObjListCom(reqDTO));
    }
/**
   * D3查询目标内容成果关系列表(公共)
   */
    @PostMapping("queryTargetContAchievementDockListCom")
    public OkrResult<QueryTargetContAchievementDockListComRespDto> queryTargetContAchievementDockListCom(@RequestBody @Validated QueryTargetContAchievementDockListComReqDto reqDTO){
    return OkrResult.success(dashboardAchievementService.queryTargetContAchievementDockListCom(reqDTO));
    }
/**
   * D3查询评价模板下一级目标分类列表(公共)
   */
    @PostMapping("queryEvaTempRootCategoryListCom")
    public OkrResult<QueryEvaTempRootCategoryListComRespDto> queryEvaTempRootCategoryListCom(@RequestBody @Validated QueryEvaTempRootCategoryListComReqDto reqDTO){
    return OkrResult.success(dashboardAchievementService.queryEvaTempRootCategoryListCom(reqDTO));
    }
/**
   * D3查询对接成果关系（分页）列表(公共)
   */
    @PostMapping("queryAchievementDockPagingListCom")
    public OkrResult<QueryAchievementDockPagingListComRespDto> queryAchievementDockPagingListCom(@RequestBody @Validated QueryAchievementDockPagingListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryAchievementDockPagingListComRespDto retData = dashboardAchievementService.queryAchievementDockPagingListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3批量查询对接成果By子周期周期ID列表（分页）
   */
    @PostMapping("batchQueryDockAchievementBySubCyclePagingListByIdsCom")
    public OkrResult<BatchQueryDockAchievementBySubCyclePagingListByIdsComRespDto> batchQueryDockAchievementBySubCyclePagingListByIdsCom(@RequestBody @Validated BatchQueryDockAchievementBySubCyclePagingListByIdsComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        BatchQueryDockAchievementBySubCyclePagingListByIdsComRespDto retData = dashboardAchievementService.batchQueryDockAchievementBySubCyclePagingListByIdsCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3批量查询对接成果By所属主体列表(分页)
   */
    @PostMapping("batchQueryAchievementDockByBelongBodyPagingListByIdsCom")
    public OkrResult<BatchQueryAchievementDockByBelongBodyPagingListByIdsComRespDto> batchQueryAchievementDockByBelongBodyPagingListByIdsCom(@RequestBody @Validated BatchQueryAchievementDockByBelongBodyPagingListByIdsComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        BatchQueryAchievementDockByBelongBodyPagingListByIdsComRespDto retData = dashboardAchievementService.batchQueryAchievementDockByBelongBodyPagingListByIdsCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3批量查询对接成果By评价画像根节点列表(分页)
   */
    @PostMapping("batchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsCom")
    public OkrResult<BatchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsComRespDto> batchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsCom(@RequestBody @Validated BatchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        BatchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsComRespDto retData = dashboardAchievementService.batchQueryDockAchievementByEvaPortraitSubRootPagingListByIdsCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3查询标志性成果明细列表(公共)
   */
    @PostMapping("queryIconicAchievementsDetailsListCom")
    public OkrResult<QueryIconicAchievementsDetailsListComRespDto> queryIconicAchievementsDetailsListCom(@RequestBody @Validated QueryIconicAchievementsDetailsListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryIconicAchievementsDetailsListComRespDto retData = dashboardAchievementService.queryIconicAchievementsDetailsListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3查询目标内容成果文档列表(公共)
   */
    @PostMapping("queryTargetContAchievementDocListCom")
    public OkrResult<QueryTargetContAchievementDocListComRespDto> queryTargetContAchievementDocListCom(@RequestBody @Validated QueryTargetContAchievementDocListComReqDto reqDTO){


        QueryTargetContAchievementDocListComRespDto retData = dashboardAchievementService.queryTargetContAchievementDocListCom(reqDTO);

        return OkrResult.success(retData);

    }
/**
   * D3查询目标内容树成果关系列表(公共)
   */
    @PostMapping("queryTargetContTreeNodeAchievementDockListCom")
    public OkrResult<QueryTargetContTreeNodeAchievementDockListComRespDto> queryTargetContTreeNodeAchievementDockListCom(@RequestBody @Validated QueryTargetContTreeNodeAchievementDockListComReqDto reqDTO){
    return OkrResult.success(dashboardAchievementService.queryTargetContTreeNodeAchievementDockListCom(reqDTO));
    }
/**
   * D3查询目标内容当前或全部成果关系列表(公共)
   */
    @PostMapping("queryTargetContCurOrAllAchievementDockListCom")
    public OkrResult<QueryTargetContCurOrAllAchievementDockListComRespDto> queryTargetContCurOrAllAchievementDockListCom(@RequestBody @Validated QueryTargetContCurOrAllAchievementDockListComReqDto reqDTO){
    return OkrResult.success(dashboardAchievementService.queryTargetContCurOrAllAchievementDockListCom(reqDTO));
    }
}
